home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr48 / pull70.zip / PULLSHEL.ZIP / PULLWORK.PAS < prev   
Pascal/Delphi Source File  |  1993-06-21  |  3KB  |  126 lines

  1. { ========================================================================== }
  2. { Pullwork.pas - Work Window procedures for main work area ver 7.0, 06-21-93 }
  3. {                for PULLSHEL.PAS                                            }
  4. { This file contains all the procedures executed for the Work Window.  These }
  5. { are the main steps of your program.  With this, you can create a sophisti- }
  6. { cated multi-level window environment.                                      }
  7. {   Copyright (c) 1988,1993 James H. LeMay, All rights reserved.             }
  8. { ========================================================================== }
  9.  
  10. {$i pulldefs.inc }
  11.  
  12. UNIT PullWork;
  13.  
  14. INTERFACE
  15.  
  16. procedure WorkWndw;
  17.  
  18.  
  19. IMPLEMENTATION
  20.  
  21. uses
  22.   Crt,Qwik,Wndw,Pull,PullStat
  23.   {$ifdef UseDataEntryCode }
  24.   ,PullData;
  25.   {$else }
  26.   ;
  27.   {$endif }
  28.  
  29. { ========================= Work Window Steps ============================== }
  30. { This procedure will have all the procedures for the Work window(s).        }
  31. { Each step assumes that some keystroke has been pressed and returns a value }
  32. { for Key and ExtKey and any necessary change to WorkWndwStep.               }
  33. { -------------------------------------------------------------------------- }
  34. var
  35.   Start1: word;
  36.  
  37. {$ifdef MultiWorkWndws }
  38. procedure ResetWorkWndwStep;
  39. begin
  40.   case TWS.WSname of
  41.     Window1:  WorkWndwStep := 1;
  42.     Window2:  WorkWndwStep := 3;
  43.   end;
  44. end;
  45.  
  46. procedure HideWorkWndw;
  47. begin
  48.   HideWindow;
  49.   TopWorkWndwName := TWS.WSname;
  50.   ResetWorkWndwStep;
  51. end;
  52.  
  53. procedure AccessWorkWndw (WN: WindowNames);
  54. begin
  55.   if WN<>TWS.WSname then
  56.     begin
  57.       { -- if accessing a PermMode window, hide all upper windows. -- }
  58.       if (GetLevelIndex(WN)<=PLI) then
  59.         while (LI>PLI) do
  60.           HideWindow;         { Use RemoveWindow for serial access }
  61.       AccessWindow (WN);
  62.       ResetWorkWndwStep;
  63.     end;
  64. end;
  65. {$endif }
  66.  
  67. procedure KbdIdle; far;
  68. begin
  69.   { Nothing to include this time, but fill in what you want to do while }
  70.   { the keyboard is idle. }
  71. end;
  72.  
  73. procedure ShowFields;
  74. begin
  75.   WWrite ( 4, 2,'Integer:');
  76.   DisplayFields (ord(aIntegerDE),ord(aIntegerDE));
  77. end;
  78. {
  79. procedure MakeWorkWndw2;
  80. begin
  81.   SetWindowModes (HiddenMode);
  82.   MakeWindow ( 8,21,10,40,LightBlue+LightGrayBG,LightBlue+LightGrayBG,
  83.                DoubleBrdr,Window2);
  84.   SetWindowModes (0);
  85.   WriteToHidden (Window2);
  86.   TitleWindow (Top   ,Left  ,SameAttr,'2');
  87.   TitleWindow (Top   ,Center,SameAttr,' Work Window 2 ');
  88.   TitleWindow (Bottom,Center,SameAttr,' Press ESC to Hide ');
  89.   WWriteC (1,'Type in any input');
  90.   WGotoRC (2,1);
  91.   WriteToCRT;
  92. end;
  93. }
  94. procedure EditFields;
  95. begin
  96.   EnterSeq (ord(aIntegerDE),ord(aIntegerDE),Start1);
  97. end;
  98.  
  99. procedure InitWorkWndws;
  100. begin
  101.   ShowFields;
  102.   WorkWndwStep := 1;
  103.   Key := NullKey;  { #00 }
  104. end;
  105.  
  106. procedure WorkWndw;
  107. begin
  108.   {$ifdef MultiWorkWndws }
  109.   AccessWorkWndw (TopWorkWndwName);
  110.   {$endif }
  111.   case WorkWndwStep of
  112.     0:  InitWorkWndws;
  113.     1:  EditFields;
  114.   end;
  115. end;
  116.  
  117. BEGIN
  118.   WorkWndwStep := 0;          { Initial step for work windows. }
  119.   {$ifdef MultiWorkWndws }
  120.   TopWorkWndwName := Window1;
  121.   {$endif }
  122.   Start1 := ord(aIntegerDE);
  123.   CallWorkWndw := WorkWndw;
  124.   CallKbdIdle  := KbdIdle;
  125. END.
  126.